<!doctype html>
<html lang="en-US">
<head>
  <meta charset="UTF-8">
  <title>Monkey Test</title>
  <link rel="stylesheet" type="text/css" href="bootstrap.css"/>
</head>
<body>
<div class="container">
  <div class="row">
    <div class="span9 offset1">
      <h1>Summary</h1>
      <div>
        <ul>
          <li>Hardware: <%= ProductType %> <%= ProductVersion %> <%= UniqueDeviceID %></li>
          <li>Application: <%= Application %> </li>
          <li>Span: <%= start_time %> ~ <%= end_time %></li>
          <li>Results: <%= test_count %> Test, <%= ok_count %> Ok, <%= cr_count %> Crash, <%= nr_count %> No Run</li>
        </ul>
      </div>
        <h1>Details</h1>
        <table class="table table-bordered">
          <thead>
          <tr>
            <th>No</th>
            <th>Result</th>
            <th>Duration</th>
            <th>message</th>
          </tr>
          </thead>
          <tbody>
          <% for result in result_list %>
            <% if result[:ok] %>
              <tr class="success">
                <td><%= result[:times]+1 %></td>
                <td>
                  <a href="<%= result[:result_dir] %>/result.html">
                    <span>OK</span>
                  </a>
                </td>
                <td><%= result[:end_time].to_i - result[:start_time].to_i%> Sec</td>
                <td><%= result[:message] %></td>
              </tr>
              
            <% elsif result[:crash] %>
              <tr class="error">
                <td><%= result[:times]+1 %></td>
                <td>
                  <a href="<%= result[:result_dir] %>/result.html">
                    <span>Crash</span>
                  </a>
                </td>
                <td><%= result[:end_time].to_i - result[:start_time].to_i%> Sec</td>
                <td><%= result[:message] %></td>
              </tr>  
            <% else %>
              <tr class="warning">
                <td><%= result[:times]+1 %></td>
                <td>
                  <a href="<%= result[:result_dir] %>/result.html">
                    <span>No Run</span>
                  </a>
                </td>
                <td><%= result[:end_time].to_i - result[:start_time].to_i%> Sec</td>
                <td><%= result[:message] %></td>
              </tr>
            <% end %>
          <% end %>
          </tbody>
        </table>
    </div>
  </div>
</div>
<script src="jquery.min.js"></script>
<script src="bootstrap.js"></script>
</body>
</html>